import 'package:flutter/material.dart';
import 'package:o78k/page/left_home.dart';

class MyApp extends StatefulWidget {
  const MyApp({super.key});
  @override
  State<StatefulWidget> createState() => Body();
}

class Body extends State<MyApp> {
  int index = 0;
  ThemeData themeData = ThemeData(
    primaryColor: const Color.fromRGBO(0, 0, 0, 0),
    highlightColor: const Color.fromRGBO(0, 228, 27, 0),
    splashColor: const Color.fromRGBO(0, 0, 0, 0),
    hoverColor: const Color.fromRGBO(0, 0, 0, 0),
  );

  getHome() {
    return Scaffold(
        body: const LeftHome(),
        bottomNavigationBar: BottomNavigationBar(
          mouseCursor: MouseCursor.uncontrolled,
          elevation: 1,
          type: BottomNavigationBarType.fixed,
          fixedColor: Colors.greenAccent,
          selectedFontSize: 12,
          onTap: (value) => {
            setState(() {
              index = value;
            }),
          },
          currentIndex: index,
          items: const [
            BottomNavigationBarItem(icon: Icon(Icons.home), label: "home"),
            BottomNavigationBarItem(icon: Icon(Icons.person), label: "persion"),
            BottomNavigationBarItem(icon: Icon(Icons.phone), label: "phone"),
            BottomNavigationBarItem(icon: Icon(Icons.settings), label: "config")
          ],
        ));
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: themeData,
      home: getHome(),
    );
  }
}
